
let userInfo = {}
try {
  userInfo = wx.getStorageSync('userInfo') || {}
} catch (e) { }

const userInfoStore = {
  userInfo: userInfo,
  
  async updateUserInfo(data) {
    this.userInfo = data;
    wx.setStorageSync('userInfo', data)
  },
  async delUserInfo() {
    this.userInfo = {}
    await wx.setStorageSync('userInfo', {})
  }
}

export {userInfoStore}
